//
//  userxiangqingItems.m
//  qulvyou
//
//  Created by mmyy on 15/10/23.
//  Copyright (c) 2015年 mmyy. All rights reserved.
//

#import "userxiangqingItems.h"
#import "tripsItems.h"
@implementation userxiangqingItems

+(instancetype)userxiangqingItemsWithDict:(NSDictionary *)dict
{
    NSDictionary *user = [dict objectForKey:@"user_info"];
    NSArray *tripss = [dict objectForKey:@"trips"];
    userxiangqingItems *items = [[userxiangqingItems alloc] init];
    items.avatar_l = [user objectForKey:@"avatar_l"];
    items.level_info_value = [[[user objectForKey:@"level_info"] objectForKey:@"value"] stringValue];
    items.followers_count = [user objectForKey:@"followers_count"];
    items.followings_count = [user objectForKey:@"followings_count"];
    items.name = [user objectForKey:@"name"];
    items.cover = [user objectForKey:@"cover"];
    items.trips = [NSMutableArray arrayWithCapacity:0];
    for (NSDictionary *model in tripss) {
        tripsItems *mitems = [tripsItems tripsItemsWithDict:model];
        if (![mitems.cover_image isKindOfClass:[NSNull class]]) {
           [items.trips addObject:mitems];
        }
        
    }
    return items;
}

@end
